package main

import (
	"fmt"
	"net"
)

func main() {
	conn, err := net.Dial("tcp", "localhost:8888")
	if err != nil {
		fmt.Println("connection server error.", err.Error())
		return
	}
	// 向服务器发送内容
	write, err := conn.Write([]byte("Hello World"))
	if err != nil {
		fmt.Println("write error.", err.Error())
		return
	}
	fmt.Println("result is:", write)
}
